3.2.47 \(\int (a+b x)^4 (A+B \log (e (a+b x)^n (c+d x)^{-n})) \, dx\) [147]

3.2.47.1 Optimal result
3.2.47.2 Mathematica [B] (verified)
3.2.47.3 Rubi [A] (verified)
3.2.47.4 Maple [B] (verified)
3.2.47.5 Fricas [B] (verification not implemented)
3.2.47.6 Sympy [F(-2)]
3.2.47.7 Maxima [B] (verification not implemented)
3.2.47.8 Giac [B] (verification not implemented)
3.2.47.9 Mupad [B] (verification not implemented)

3.2.47.1 Optimal result

Integrand size = 31, antiderivative size = 171 \[ \int (a+b x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {B (b c-a d)^4 n x}{5 d^4}-\frac {B (b c-a d)^3 n (a+b x)^2}{10 b d^3}+\frac {B (b c-a d)^2 n (a+b x)^3}{15 b d^2}-\frac {B (b c-a d) n (a+b x)^4}{20 b d}-\frac {B (b c-a d)^5 n \log (c+d x)}{5 b d^5}+\frac {(a+b x)^5 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{5 b} \]

output
1/5*B*(-a*d+b*c)^4*n*x/d^4-1/10*B*(-a*d+b*c)^3*n*(b*x+a)^2/b/d^3+1/15*B*(- 
a*d+b*c)^2*n*(b*x+a)^3/b/d^2-1/20*B*(-a*d+b*c)*n*(b*x+a)^4/b/d-1/5*B*(-a*d 
+b*c)^5*n*ln(d*x+c)/b/d^5+1/5*(b*x+a)^5*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))/ 
b
 
3.2.47.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(364\) vs. \(2(171)=342\).

Time = 0.54 (sec) , antiderivative size = 364, normalized size of antiderivative = 2.13 \[ \int (a+b x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {b d x \left (12 a^4 d^4 (5 A+4 B n)+12 a^3 b d^3 (-10 B c n+10 A d x+3 B d n x)+4 a^2 b^2 d^2 \left (30 A d^2 x^2+B n \left (30 c^2-15 c d x+4 d^2 x^2\right )\right )+b^4 \left (12 A d^4 x^4+B c n \left (12 c^3-6 c^2 d x+4 c d^2 x^2-3 d^3 x^3\right )\right )+a b^3 d \left (60 A d^3 x^3+B n \left (-60 c^3+30 c^2 d x-20 c d^2 x^2+3 d^3 x^3\right )\right )\right )-48 a^5 B d^5 n \log (a+b x)-12 B \left (b^5 c^5-5 a b^4 c^4 d+10 a^2 b^3 c^3 d^2-10 a^3 b^2 c^2 d^3+5 a^4 b c d^4-5 a^5 d^5\right ) n \log (c+d x)+12 B d^5 \left (5 a^5+5 a^4 b x+10 a^3 b^2 x^2+10 a^2 b^3 x^3+5 a b^4 x^4+b^5 x^5\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{60 b d^5} \]

input
Integrate[(a + b*x)^4*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n]),x]
 
output
(b*d*x*(12*a^4*d^4*(5*A + 4*B*n) + 12*a^3*b*d^3*(-10*B*c*n + 10*A*d*x + 3* 
B*d*n*x) + 4*a^2*b^2*d^2*(30*A*d^2*x^2 + B*n*(30*c^2 - 15*c*d*x + 4*d^2*x^ 
2)) + b^4*(12*A*d^4*x^4 + B*c*n*(12*c^3 - 6*c^2*d*x + 4*c*d^2*x^2 - 3*d^3* 
x^3)) + a*b^3*d*(60*A*d^3*x^3 + B*n*(-60*c^3 + 30*c^2*d*x - 20*c*d^2*x^2 + 
 3*d^3*x^3))) - 48*a^5*B*d^5*n*Log[a + b*x] - 12*B*(b^5*c^5 - 5*a*b^4*c^4* 
d + 10*a^2*b^3*c^3*d^2 - 10*a^3*b^2*c^2*d^3 + 5*a^4*b*c*d^4 - 5*a^5*d^5)*n 
*Log[c + d*x] + 12*B*d^5*(5*a^5 + 5*a^4*b*x + 10*a^3*b^2*x^2 + 10*a^2*b^3* 
x^3 + 5*a*b^4*x^4 + b^5*x^5)*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(60*b*d^5)
 
3.2.47.3 Rubi [A] (verified)

Time = 0.30 (sec) , antiderivative size = 153, normalized size of antiderivative = 0.89, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {2948, 49, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (a+b x)^4 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right ) \, dx\)

\(\Big \downarrow \) 2948

\(\displaystyle \frac {(a+b x)^5 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{5 b}-\frac {B n (b c-a d) \int \frac {(a+b x)^4}{c+d x}dx}{5 b}\)

\(\Big \downarrow \) 49

\(\displaystyle \frac {(a+b x)^5 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{5 b}-\frac {B n (b c-a d) \int \left (\frac {(a d-b c)^4}{d^4 (c+d x)}-\frac {b (b c-a d)^3}{d^4}+\frac {b (a+b x)^3}{d}-\frac {b (b c-a d) (a+b x)^2}{d^2}+\frac {b (b c-a d)^2 (a+b x)}{d^3}\right )dx}{5 b}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {(a+b x)^5 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{5 b}-\frac {B n (b c-a d) \left (\frac {(b c-a d)^4 \log (c+d x)}{d^5}-\frac {b x (b c-a d)^3}{d^4}+\frac {(a+b x)^2 (b c-a d)^2}{2 d^3}-\frac {(a+b x)^3 (b c-a d)}{3 d^2}+\frac {(a+b x)^4}{4 d}\right )}{5 b}\)

input
Int[(a + b*x)^4*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n]),x]
 
output
-1/5*(B*(b*c - a*d)*n*(-((b*(b*c - a*d)^3*x)/d^4) + ((b*c - a*d)^2*(a + b* 
x)^2)/(2*d^3) - ((b*c - a*d)*(a + b*x)^3)/(3*d^2) + (a + b*x)^4/(4*d) + (( 
b*c - a*d)^4*Log[c + d*x])/d^5))/b + ((a + b*x)^5*(A + B*Log[(e*(a + b*x)^ 
n)/(c + d*x)^n]))/(5*b)
 

3.2.47.3.1 Defintions of rubi rules used

rule 49
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int 
[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] 
&& IGtQ[m, 0] && IGtQ[m + n + 2, 0]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2948
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ 
)]*(B_.))*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(f + g*x)^(m + 1)*( 
(A + B*Log[e*((a + b*x)^n/(c + d*x)^n)])/(g*(m + 1))), x] - Simp[B*n*((b*c 
- a*d)/(g*(m + 1)))   Int[(f + g*x)^(m + 1)/((a + b*x)*(c + d*x)), x], x] / 
; FreeQ[{a, b, c, d, e, f, g, A, B, m, n}, x] && EqQ[n + mn, 0] && NeQ[b*c 
- a*d, 0] && NeQ[m, -1] &&  !(EqQ[m, -2] && IntegerQ[n])
 
3.2.47.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(831\) vs. \(2(159)=318\).

Time = 134.47 (sec) , antiderivative size = 832, normalized size of antiderivative = 4.87

method result size
parallelrisch \(\frac {120 A \,x^{2} a^{4} b^{2} c \,d^{5} n +48 B x \,a^{5} b c \,d^{5} n^{2}-120 B x \,a^{4} b^{2} c^{2} d^{4} n^{2}+120 B x \,a^{3} b^{3} c^{3} d^{3} n^{2}-60 B x \,a^{2} b^{4} c^{4} d^{2} n^{2}+12 B x a \,b^{5} c^{5} d \,n^{2}+60 A x \,a^{5} b c \,d^{5} n -60 B \ln \left (b x +a \right ) a^{5} b \,c^{2} d^{4} n^{2}+120 B \ln \left (b x +a \right ) a^{4} b^{2} c^{3} d^{3} n^{2}-120 B \ln \left (b x +a \right ) a^{3} b^{3} c^{4} d^{2} n^{2}+60 B \ln \left (b x +a \right ) a^{2} b^{4} c^{5} d \,n^{2}+12 B \ln \left (b x +a \right ) a^{6} c \,d^{5} n^{2}-12 B \ln \left (b x +a \right ) a \,b^{5} c^{6} n^{2}+60 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a^{5} b \,c^{2} d^{4} n -120 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a^{4} b^{2} c^{3} d^{3} n +120 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a^{3} b^{3} c^{4} d^{2} n -60 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a^{2} b^{4} c^{5} d n +12 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a \,b^{5} c^{6} n +12 A \,x^{5} a \,b^{5} c \,d^{5} n +3 B \,x^{4} a^{2} b^{4} c \,d^{5} n^{2}-3 B \,x^{4} a \,b^{5} c^{2} d^{4} n^{2}+60 A \,x^{4} a^{2} b^{4} c \,d^{5} n +16 B \,x^{3} a^{3} b^{3} c \,d^{5} n^{2}-20 B \,x^{3} a^{2} b^{4} c^{2} d^{4} n^{2}+4 B \,x^{3} a \,b^{5} c^{3} d^{3} n^{2}+120 A \,x^{3} a^{3} b^{3} c \,d^{5} n +36 B \,x^{2} a^{4} b^{2} c \,d^{5} n^{2}-60 B \,x^{2} a^{3} b^{3} c^{2} d^{4} n^{2}+30 B \,x^{2} a^{2} b^{4} c^{3} d^{3} n^{2}-6 B \,x^{2} a \,b^{5} c^{4} d^{2} n^{2}+12 B \,x^{5} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a \,b^{5} c \,d^{5} n +60 B \,x^{4} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a^{2} b^{4} c \,d^{5} n +120 B \,x^{3} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a^{3} b^{3} c \,d^{5} n +120 B \,x^{2} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a^{4} b^{2} c \,d^{5} n +60 B x \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a^{5} b c \,d^{5} n}{60 b a c \,d^{5} n}\) \(832\)
risch \(\text {Expression too large to display}\) \(2372\)

input
int((b*x+a)^4*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n))),x,method=_RETURNVERBOSE)
 
output
1/60*(120*A*x^2*a^4*b^2*c*d^5*n+48*B*x*a^5*b*c*d^5*n^2-120*B*x*a^4*b^2*c^2 
*d^4*n^2+120*B*x*a^3*b^3*c^3*d^3*n^2-60*B*x*a^2*b^4*c^4*d^2*n^2+12*B*x*a*b 
^5*c^5*d*n^2+60*A*x*a^5*b*c*d^5*n+60*B*ln(e*(b*x+a)^n/((d*x+c)^n))*a^5*b*c 
^2*d^4*n-120*B*ln(e*(b*x+a)^n/((d*x+c)^n))*a^4*b^2*c^3*d^3*n+120*B*ln(e*(b 
*x+a)^n/((d*x+c)^n))*a^3*b^3*c^4*d^2*n-60*B*ln(e*(b*x+a)^n/((d*x+c)^n))*a^ 
2*b^4*c^5*d*n-60*B*ln(b*x+a)*a^5*b*c^2*d^4*n^2+120*B*ln(b*x+a)*a^4*b^2*c^3 
*d^3*n^2-120*B*ln(b*x+a)*a^3*b^3*c^4*d^2*n^2+60*B*ln(b*x+a)*a^2*b^4*c^5*d* 
n^2+12*B*ln(e*(b*x+a)^n/((d*x+c)^n))*a*b^5*c^6*n+12*B*ln(b*x+a)*a^6*c*d^5* 
n^2-12*B*ln(b*x+a)*a*b^5*c^6*n^2+12*B*x^5*ln(e*(b*x+a)^n/((d*x+c)^n))*a*b^ 
5*c*d^5*n+12*A*x^5*a*b^5*c*d^5*n+3*B*x^4*a^2*b^4*c*d^5*n^2-3*B*x^4*a*b^5*c 
^2*d^4*n^2+60*A*x^4*a^2*b^4*c*d^5*n+16*B*x^3*a^3*b^3*c*d^5*n^2-20*B*x^3*a^ 
2*b^4*c^2*d^4*n^2+4*B*x^3*a*b^5*c^3*d^3*n^2+120*A*x^3*a^3*b^3*c*d^5*n+36*B 
*x^2*a^4*b^2*c*d^5*n^2-60*B*x^2*a^3*b^3*c^2*d^4*n^2+30*B*x^2*a^2*b^4*c^3*d 
^3*n^2-6*B*x^2*a*b^5*c^4*d^2*n^2+60*B*x^4*ln(e*(b*x+a)^n/((d*x+c)^n))*a^2* 
b^4*c*d^5*n+120*B*x^3*ln(e*(b*x+a)^n/((d*x+c)^n))*a^3*b^3*c*d^5*n+120*B*x^ 
2*ln(e*(b*x+a)^n/((d*x+c)^n))*a^4*b^2*c*d^5*n+60*B*x*ln(e*(b*x+a)^n/((d*x+ 
c)^n))*a^5*b*c*d^5*n)/b/a/c/d^5/n
 
3.2.47.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 563 vs. \(2 (159) = 318\).

Time = 0.26 (sec) , antiderivative size = 563, normalized size of antiderivative = 3.29 \[ \int (a+b x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {12 \, A b^{5} d^{5} x^{5} + 3 \, {\left (20 \, A a b^{4} d^{5} - {\left (B b^{5} c d^{4} - B a b^{4} d^{5}\right )} n\right )} x^{4} + 4 \, {\left (30 \, A a^{2} b^{3} d^{5} + {\left (B b^{5} c^{2} d^{3} - 5 \, B a b^{4} c d^{4} + 4 \, B a^{2} b^{3} d^{5}\right )} n\right )} x^{3} + 6 \, {\left (20 \, A a^{3} b^{2} d^{5} - {\left (B b^{5} c^{3} d^{2} - 5 \, B a b^{4} c^{2} d^{3} + 10 \, B a^{2} b^{3} c d^{4} - 6 \, B a^{3} b^{2} d^{5}\right )} n\right )} x^{2} + 12 \, {\left (5 \, A a^{4} b d^{5} + {\left (B b^{5} c^{4} d - 5 \, B a b^{4} c^{3} d^{2} + 10 \, B a^{2} b^{3} c^{2} d^{3} - 10 \, B a^{3} b^{2} c d^{4} + 4 \, B a^{4} b d^{5}\right )} n\right )} x + 12 \, {\left (B b^{5} d^{5} n x^{5} + 5 \, B a b^{4} d^{5} n x^{4} + 10 \, B a^{2} b^{3} d^{5} n x^{3} + 10 \, B a^{3} b^{2} d^{5} n x^{2} + 5 \, B a^{4} b d^{5} n x + B a^{5} d^{5} n\right )} \log \left (b x + a\right ) - 12 \, {\left (B b^{5} d^{5} n x^{5} + 5 \, B a b^{4} d^{5} n x^{4} + 10 \, B a^{2} b^{3} d^{5} n x^{3} + 10 \, B a^{3} b^{2} d^{5} n x^{2} + 5 \, B a^{4} b d^{5} n x + {\left (B b^{5} c^{5} - 5 \, B a b^{4} c^{4} d + 10 \, B a^{2} b^{3} c^{3} d^{2} - 10 \, B a^{3} b^{2} c^{2} d^{3} + 5 \, B a^{4} b c d^{4}\right )} n\right )} \log \left (d x + c\right ) + 12 \, {\left (B b^{5} d^{5} x^{5} + 5 \, B a b^{4} d^{5} x^{4} + 10 \, B a^{2} b^{3} d^{5} x^{3} + 10 \, B a^{3} b^{2} d^{5} x^{2} + 5 \, B a^{4} b d^{5} x\right )} \log \left (e\right )}{60 \, b d^{5}} \]

input
integrate((b*x+a)^4*(A+B*log(e*(b*x+a)^n/((d*x+c)^n))),x, algorithm="frica 
s")
 
output
1/60*(12*A*b^5*d^5*x^5 + 3*(20*A*a*b^4*d^5 - (B*b^5*c*d^4 - B*a*b^4*d^5)*n 
)*x^4 + 4*(30*A*a^2*b^3*d^5 + (B*b^5*c^2*d^3 - 5*B*a*b^4*c*d^4 + 4*B*a^2*b 
^3*d^5)*n)*x^3 + 6*(20*A*a^3*b^2*d^5 - (B*b^5*c^3*d^2 - 5*B*a*b^4*c^2*d^3 
+ 10*B*a^2*b^3*c*d^4 - 6*B*a^3*b^2*d^5)*n)*x^2 + 12*(5*A*a^4*b*d^5 + (B*b^ 
5*c^4*d - 5*B*a*b^4*c^3*d^2 + 10*B*a^2*b^3*c^2*d^3 - 10*B*a^3*b^2*c*d^4 + 
4*B*a^4*b*d^5)*n)*x + 12*(B*b^5*d^5*n*x^5 + 5*B*a*b^4*d^5*n*x^4 + 10*B*a^2 
*b^3*d^5*n*x^3 + 10*B*a^3*b^2*d^5*n*x^2 + 5*B*a^4*b*d^5*n*x + B*a^5*d^5*n) 
*log(b*x + a) - 12*(B*b^5*d^5*n*x^5 + 5*B*a*b^4*d^5*n*x^4 + 10*B*a^2*b^3*d 
^5*n*x^3 + 10*B*a^3*b^2*d^5*n*x^2 + 5*B*a^4*b*d^5*n*x + (B*b^5*c^5 - 5*B*a 
*b^4*c^4*d + 10*B*a^2*b^3*c^3*d^2 - 10*B*a^3*b^2*c^2*d^3 + 5*B*a^4*b*c*d^4 
)*n)*log(d*x + c) + 12*(B*b^5*d^5*x^5 + 5*B*a*b^4*d^5*x^4 + 10*B*a^2*b^3*d 
^5*x^3 + 10*B*a^3*b^2*d^5*x^2 + 5*B*a^4*b*d^5*x)*log(e))/(b*d^5)
 
3.2.47.6 Sympy [F(-2)]

Exception generated. \[ \int (a+b x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\text {Exception raised: HeuristicGCDFailed} \]

input
integrate((b*x+a)**4*(A+B*ln(e*(b*x+a)**n/((d*x+c)**n))),x)
 
output
Exception raised: HeuristicGCDFailed >> no luck
 
3.2.47.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 671 vs. \(2 (159) = 318\).

Time = 0.22 (sec) , antiderivative size = 671, normalized size of antiderivative = 3.92 \[ \int (a+b x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {1}{5} \, B b^{4} x^{5} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac {1}{5} \, A b^{4} x^{5} + B a b^{3} x^{4} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A a b^{3} x^{4} + 2 \, B a^{2} b^{2} x^{3} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + 2 \, A a^{2} b^{2} x^{3} + 2 \, B a^{3} b x^{2} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + 2 \, A a^{3} b x^{2} + B a^{4} x \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A a^{4} x + \frac {{\left (\frac {a e n \log \left (b x + a\right )}{b} - \frac {c e n \log \left (d x + c\right )}{d}\right )} B a^{4}}{e} - \frac {2 \, {\left (\frac {a^{2} e n \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} e n \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c e n - a d e n\right )} x}{b d}\right )} B a^{3} b}{e} + \frac {{\left (\frac {2 \, a^{3} e n \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} e n \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d e n - a b d^{2} e n\right )} x^{2} - 2 \, {\left (b^{2} c^{2} e n - a^{2} d^{2} e n\right )} x}{b^{2} d^{2}}\right )} B a^{2} b^{2}}{e} - \frac {{\left (\frac {6 \, a^{4} e n \log \left (b x + a\right )}{b^{4}} - \frac {6 \, c^{4} e n \log \left (d x + c\right )}{d^{4}} + \frac {2 \, {\left (b^{3} c d^{2} e n - a b^{2} d^{3} e n\right )} x^{3} - 3 \, {\left (b^{3} c^{2} d e n - a^{2} b d^{3} e n\right )} x^{2} + 6 \, {\left (b^{3} c^{3} e n - a^{3} d^{3} e n\right )} x}{b^{3} d^{3}}\right )} B a b^{3}}{6 \, e} + \frac {{\left (\frac {12 \, a^{5} e n \log \left (b x + a\right )}{b^{5}} - \frac {12 \, c^{5} e n \log \left (d x + c\right )}{d^{5}} - \frac {3 \, {\left (b^{4} c d^{3} e n - a b^{3} d^{4} e n\right )} x^{4} - 4 \, {\left (b^{4} c^{2} d^{2} e n - a^{2} b^{2} d^{4} e n\right )} x^{3} + 6 \, {\left (b^{4} c^{3} d e n - a^{3} b d^{4} e n\right )} x^{2} - 12 \, {\left (b^{4} c^{4} e n - a^{4} d^{4} e n\right )} x}{b^{4} d^{4}}\right )} B b^{4}}{60 \, e} \]

input
integrate((b*x+a)^4*(A+B*log(e*(b*x+a)^n/((d*x+c)^n))),x, algorithm="maxim 
a")
 
output
1/5*B*b^4*x^5*log((b*x + a)^n*e/(d*x + c)^n) + 1/5*A*b^4*x^5 + B*a*b^3*x^4 
*log((b*x + a)^n*e/(d*x + c)^n) + A*a*b^3*x^4 + 2*B*a^2*b^2*x^3*log((b*x + 
 a)^n*e/(d*x + c)^n) + 2*A*a^2*b^2*x^3 + 2*B*a^3*b*x^2*log((b*x + a)^n*e/( 
d*x + c)^n) + 2*A*a^3*b*x^2 + B*a^4*x*log((b*x + a)^n*e/(d*x + c)^n) + A*a 
^4*x + (a*e*n*log(b*x + a)/b - c*e*n*log(d*x + c)/d)*B*a^4/e - 2*(a^2*e*n* 
log(b*x + a)/b^2 - c^2*e*n*log(d*x + c)/d^2 + (b*c*e*n - a*d*e*n)*x/(b*d)) 
*B*a^3*b/e + (2*a^3*e*n*log(b*x + a)/b^3 - 2*c^3*e*n*log(d*x + c)/d^3 - (( 
b^2*c*d*e*n - a*b*d^2*e*n)*x^2 - 2*(b^2*c^2*e*n - a^2*d^2*e*n)*x)/(b^2*d^2 
))*B*a^2*b^2/e - 1/6*(6*a^4*e*n*log(b*x + a)/b^4 - 6*c^4*e*n*log(d*x + c)/ 
d^4 + (2*(b^3*c*d^2*e*n - a*b^2*d^3*e*n)*x^3 - 3*(b^3*c^2*d*e*n - a^2*b*d^ 
3*e*n)*x^2 + 6*(b^3*c^3*e*n - a^3*d^3*e*n)*x)/(b^3*d^3))*B*a*b^3/e + 1/60* 
(12*a^5*e*n*log(b*x + a)/b^5 - 12*c^5*e*n*log(d*x + c)/d^5 - (3*(b^4*c*d^3 
*e*n - a*b^3*d^4*e*n)*x^4 - 4*(b^4*c^2*d^2*e*n - a^2*b^2*d^4*e*n)*x^3 + 6* 
(b^4*c^3*d*e*n - a^3*b*d^4*e*n)*x^2 - 12*(b^4*c^4*e*n - a^4*d^4*e*n)*x)/(b 
^4*d^4))*B*b^4/e
 
3.2.47.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 507 vs. \(2 (159) = 318\).

Time = 7.18 (sec) , antiderivative size = 507, normalized size of antiderivative = 2.96 \[ \int (a+b x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {B a^{5} n \log \left (b x + a\right )}{5 \, b} + \frac {1}{5} \, {\left (B b^{4} \log \left (e\right ) + A b^{4}\right )} x^{5} - \frac {{\left (B b^{4} c n - B a b^{3} d n - 20 \, B a b^{3} d \log \left (e\right ) - 20 \, A a b^{3} d\right )} x^{4}}{20 \, d} + \frac {{\left (B b^{4} c^{2} n - 5 \, B a b^{3} c d n + 4 \, B a^{2} b^{2} d^{2} n + 30 \, B a^{2} b^{2} d^{2} \log \left (e\right ) + 30 \, A a^{2} b^{2} d^{2}\right )} x^{3}}{15 \, d^{2}} + \frac {1}{5} \, {\left (B b^{4} n x^{5} + 5 \, B a b^{3} n x^{4} + 10 \, B a^{2} b^{2} n x^{3} + 10 \, B a^{3} b n x^{2} + 5 \, B a^{4} n x\right )} \log \left (b x + a\right ) - \frac {1}{5} \, {\left (B b^{4} n x^{5} + 5 \, B a b^{3} n x^{4} + 10 \, B a^{2} b^{2} n x^{3} + 10 \, B a^{3} b n x^{2} + 5 \, B a^{4} n x\right )} \log \left (d x + c\right ) - \frac {{\left (B b^{4} c^{3} n - 5 \, B a b^{3} c^{2} d n + 10 \, B a^{2} b^{2} c d^{2} n - 6 \, B a^{3} b d^{3} n - 20 \, B a^{3} b d^{3} \log \left (e\right ) - 20 \, A a^{3} b d^{3}\right )} x^{2}}{10 \, d^{3}} + \frac {{\left (B b^{4} c^{4} n - 5 \, B a b^{3} c^{3} d n + 10 \, B a^{2} b^{2} c^{2} d^{2} n - 10 \, B a^{3} b c d^{3} n + 4 \, B a^{4} d^{4} n + 5 \, B a^{4} d^{4} \log \left (e\right ) + 5 \, A a^{4} d^{4}\right )} x}{5 \, d^{4}} - \frac {{\left (B b^{4} c^{5} n - 5 \, B a b^{3} c^{4} d n + 10 \, B a^{2} b^{2} c^{3} d^{2} n - 10 \, B a^{3} b c^{2} d^{3} n + 5 \, B a^{4} c d^{4} n\right )} \log \left (-d x - c\right )}{5 \, d^{5}} \]

input
integrate((b*x+a)^4*(A+B*log(e*(b*x+a)^n/((d*x+c)^n))),x, algorithm="giac" 
)
 
output
1/5*B*a^5*n*log(b*x + a)/b + 1/5*(B*b^4*log(e) + A*b^4)*x^5 - 1/20*(B*b^4* 
c*n - B*a*b^3*d*n - 20*B*a*b^3*d*log(e) - 20*A*a*b^3*d)*x^4/d + 1/15*(B*b^ 
4*c^2*n - 5*B*a*b^3*c*d*n + 4*B*a^2*b^2*d^2*n + 30*B*a^2*b^2*d^2*log(e) + 
30*A*a^2*b^2*d^2)*x^3/d^2 + 1/5*(B*b^4*n*x^5 + 5*B*a*b^3*n*x^4 + 10*B*a^2* 
b^2*n*x^3 + 10*B*a^3*b*n*x^2 + 5*B*a^4*n*x)*log(b*x + a) - 1/5*(B*b^4*n*x^ 
5 + 5*B*a*b^3*n*x^4 + 10*B*a^2*b^2*n*x^3 + 10*B*a^3*b*n*x^2 + 5*B*a^4*n*x) 
*log(d*x + c) - 1/10*(B*b^4*c^3*n - 5*B*a*b^3*c^2*d*n + 10*B*a^2*b^2*c*d^2 
*n - 6*B*a^3*b*d^3*n - 20*B*a^3*b*d^3*log(e) - 20*A*a^3*b*d^3)*x^2/d^3 + 1 
/5*(B*b^4*c^4*n - 5*B*a*b^3*c^3*d*n + 10*B*a^2*b^2*c^2*d^2*n - 10*B*a^3*b* 
c*d^3*n + 4*B*a^4*d^4*n + 5*B*a^4*d^4*log(e) + 5*A*a^4*d^4)*x/d^4 - 1/5*(B 
*b^4*c^5*n - 5*B*a*b^3*c^4*d*n + 10*B*a^2*b^2*c^3*d^2*n - 10*B*a^3*b*c^2*d 
^3*n + 5*B*a^4*c*d^4*n)*log(-d*x - c)/d^5
 
3.2.47.9 Mupad [B] (verification not implemented)

Time = 1.43 (sec) , antiderivative size = 936, normalized size of antiderivative = 5.47 \[ \int (a+b x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=x^4\,\left (\frac {b^3\,\left (25\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{20\,d}-\frac {A\,b^3\,\left (5\,a\,d+5\,b\,c\right )}{20\,d}\right )-x^3\,\left (\frac {\left (5\,a\,d+5\,b\,c\right )\,\left (\frac {b^3\,\left (25\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5\,d}-\frac {A\,b^3\,\left (5\,a\,d+5\,b\,c\right )}{5\,d}\right )}{15\,b\,d}-\frac {a\,b^2\,\left (10\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{3\,d}+\frac {A\,a\,b^3\,c}{3\,d}\right )+\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\,\left (B\,a^4\,x+2\,B\,a^3\,b\,x^2+2\,B\,a^2\,b^2\,x^3+B\,a\,b^3\,x^4+\frac {B\,b^4\,x^5}{5}\right )+x\,\left (\frac {a^3\,\left (5\,A\,a\,d+10\,A\,b\,c+2\,B\,a\,d\,n-2\,B\,b\,c\,n\right )}{d}-\frac {\left (5\,a\,d+5\,b\,c\right )\,\left (\frac {2\,a^2\,b\,\left (5\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{d}+\frac {\left (5\,a\,d+5\,b\,c\right )\,\left (\frac {\left (5\,a\,d+5\,b\,c\right )\,\left (\frac {b^3\,\left (25\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5\,d}-\frac {A\,b^3\,\left (5\,a\,d+5\,b\,c\right )}{5\,d}\right )}{5\,b\,d}-\frac {a\,b^2\,\left (10\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{d}+\frac {A\,a\,b^3\,c}{d}\right )}{5\,b\,d}-\frac {a\,c\,\left (\frac {b^3\,\left (25\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5\,d}-\frac {A\,b^3\,\left (5\,a\,d+5\,b\,c\right )}{5\,d}\right )}{b\,d}\right )}{5\,b\,d}+\frac {a\,c\,\left (\frac {\left (5\,a\,d+5\,b\,c\right )\,\left (\frac {b^3\,\left (25\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5\,d}-\frac {A\,b^3\,\left (5\,a\,d+5\,b\,c\right )}{5\,d}\right )}{5\,b\,d}-\frac {a\,b^2\,\left (10\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{d}+\frac {A\,a\,b^3\,c}{d}\right )}{b\,d}\right )+x^2\,\left (\frac {a^2\,b\,\left (5\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{d}+\frac {\left (5\,a\,d+5\,b\,c\right )\,\left (\frac {\left (5\,a\,d+5\,b\,c\right )\,\left (\frac {b^3\,\left (25\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5\,d}-\frac {A\,b^3\,\left (5\,a\,d+5\,b\,c\right )}{5\,d}\right )}{5\,b\,d}-\frac {a\,b^2\,\left (10\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{d}+\frac {A\,a\,b^3\,c}{d}\right )}{10\,b\,d}-\frac {a\,c\,\left (\frac {b^3\,\left (25\,A\,a\,d+5\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5\,d}-\frac {A\,b^3\,\left (5\,a\,d+5\,b\,c\right )}{5\,d}\right )}{2\,b\,d}\right )+\frac {A\,b^4\,x^5}{5}-\frac {\ln \left (c+d\,x\right )\,\left (5\,B\,n\,a^4\,c\,d^4-10\,B\,n\,a^3\,b\,c^2\,d^3+10\,B\,n\,a^2\,b^2\,c^3\,d^2-5\,B\,n\,a\,b^3\,c^4\,d+B\,n\,b^4\,c^5\right )}{5\,d^5}+\frac {B\,a^5\,n\,\ln \left (a+b\,x\right )}{5\,b} \]

input
int((A + B*log((e*(a + b*x)^n)/(c + d*x)^n))*(a + b*x)^4,x)
 
output
x^4*((b^3*(25*A*a*d + 5*A*b*c + B*a*d*n - B*b*c*n))/(20*d) - (A*b^3*(5*a*d 
 + 5*b*c))/(20*d)) - x^3*(((5*a*d + 5*b*c)*((b^3*(25*A*a*d + 5*A*b*c + B*a 
*d*n - B*b*c*n))/(5*d) - (A*b^3*(5*a*d + 5*b*c))/(5*d)))/(15*b*d) - (a*b^2 
*(10*A*a*d + 5*A*b*c + B*a*d*n - B*b*c*n))/(3*d) + (A*a*b^3*c)/(3*d)) + lo 
g((e*(a + b*x)^n)/(c + d*x)^n)*((B*b^4*x^5)/5 + B*a^4*x + 2*B*a^3*b*x^2 + 
B*a*b^3*x^4 + 2*B*a^2*b^2*x^3) + x*((a^3*(5*A*a*d + 10*A*b*c + 2*B*a*d*n - 
 2*B*b*c*n))/d - ((5*a*d + 5*b*c)*((2*a^2*b*(5*A*a*d + 5*A*b*c + B*a*d*n - 
 B*b*c*n))/d + ((5*a*d + 5*b*c)*(((5*a*d + 5*b*c)*((b^3*(25*A*a*d + 5*A*b* 
c + B*a*d*n - B*b*c*n))/(5*d) - (A*b^3*(5*a*d + 5*b*c))/(5*d)))/(5*b*d) - 
(a*b^2*(10*A*a*d + 5*A*b*c + B*a*d*n - B*b*c*n))/d + (A*a*b^3*c)/d))/(5*b* 
d) - (a*c*((b^3*(25*A*a*d + 5*A*b*c + B*a*d*n - B*b*c*n))/(5*d) - (A*b^3*( 
5*a*d + 5*b*c))/(5*d)))/(b*d)))/(5*b*d) + (a*c*(((5*a*d + 5*b*c)*((b^3*(25 
*A*a*d + 5*A*b*c + B*a*d*n - B*b*c*n))/(5*d) - (A*b^3*(5*a*d + 5*b*c))/(5* 
d)))/(5*b*d) - (a*b^2*(10*A*a*d + 5*A*b*c + B*a*d*n - B*b*c*n))/d + (A*a*b 
^3*c)/d))/(b*d)) + x^2*((a^2*b*(5*A*a*d + 5*A*b*c + B*a*d*n - B*b*c*n))/d 
+ ((5*a*d + 5*b*c)*(((5*a*d + 5*b*c)*((b^3*(25*A*a*d + 5*A*b*c + B*a*d*n - 
 B*b*c*n))/(5*d) - (A*b^3*(5*a*d + 5*b*c))/(5*d)))/(5*b*d) - (a*b^2*(10*A* 
a*d + 5*A*b*c + B*a*d*n - B*b*c*n))/d + (A*a*b^3*c)/d))/(10*b*d) - (a*c*(( 
b^3*(25*A*a*d + 5*A*b*c + B*a*d*n - B*b*c*n))/(5*d) - (A*b^3*(5*a*d + 5*b* 
c))/(5*d)))/(2*b*d)) + (A*b^4*x^5)/5 - (log(c + d*x)*(B*b^4*c^5*n + 5*B...